<%@page language="java" contentType="text/html; charset=ISO-8859-1"	pageEncoding="ISO-8859-1"%>
<%@taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="security"	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@ taglib prefix="acme" tagdir="/WEB-INF/tags" %>

<form:form action="register/${authority.toLowerCase()}/save.do" modelAttribute="registerForm">

	
	<h3><b><spring:message code="userAccount.details" /></b></h3>
	<br />
	<form:hidden path="userAccount.authorities" value="${authority}"/>
	<acme:textbox path="userAccount.username" code="userAccount.username" /><br />
	<acme:password code="userAccount.password" path="userAccount.password" /><br />
	<acme:password code="userAccount.confirmPassword" path="repeatPass" /><br />
	
	<h3><b><spring:message code="personal.information" /></b></h3>
	<br />
	
	<acme:textbox path="name" code="name" /><br />
	<acme:textbox path="surnames" code="surnames" /><br />
	<acme:textbox path="email" code="email" /><br />
	
	<jstl:if test="${authority == \"CUSTOMER\"}">
		<h3><b><spring:message code="creditCard.details" /></b></h3> <br />
		
		<acme:textbox path="creditCard.holderName" code="creditCard.holderName" /><br />
		<acme:textbox path="creditCard.brandName" code="creditCard.brandName" /><br />
		<acme:textbox path="creditCard.number" code="creditCard.number" /><br />
		<acme:textbox path="creditCard.expirationMonth" code="creditCard.expirationMonth" /><br />
		<acme:textbox path="creditCard.expirationYear" code="creditCard.expirationYear" /><br />
		<acme:textbox path="creditCard.cvv" code="creditCard.cvv" /><br />
	</jstl:if>
	
	<form:checkbox path="terminos" id="terms" value="false" name="terms"   />
	<spring:message code="register.terms" />
	<br><p/>
	<spring:message code="register.confirm.save" var="saveMessage" />
	<acme:submit name="save" code="register.save" onclick ="return confirm('${saveMessage}')" />
	
	<acme:cancel url="welcome/index.do" code="register.cancel" />

</form:form>

